﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Data;

namespace PhotoBook.Model.Converters
{
    [ValueConversion(typeof(Double), typeof(Double))]
    public class ConverterParaMetade : IValueConverter
    {

        #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            if (value.GetType() == typeof(double))
                return ((double)value) / 2;
            else
                return value;
        }

        public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            throw new NotImplementedException("ConverterParaMetade.ConvertBack");
        }

        #endregion
    }
}
